﻿@model List<TestOnlineProject.Models.Entities.Participant>
@{
    ViewBag.Title = "Discussion";
}
<div class="site_map">
    @Html.ActionLink("Home", "Index", "Home", new { Area = "" }, new { }) / Subjects
</div>
<br />
<div>
    <div class="tabbable tabs-left">
        <ul class="nav nav-tabs">
            <li>
                @Html.ActionLink("Overview", "Index", "Account", new { userId = @ViewBag.User.UserId }, null)
            </li>
            <li class="active">
                <a data-toggle="tab" href="#subject">Subjects</a>
            </li>
            <li>
                @Html.ActionLink("Discussions", "Discussion", "Account", new { userId = @ViewBag.User.UserId }, null)
            </li>
            @if (@ViewBag.User.UserId == int.Parse(HttpContext.Current.User.Identity.Name))
            {
                <li>
                    @Html.ActionLink("Password", "ChangePassword", "Account", new { userId = @ViewBag.User.UserId }, new { })
                </li>
            }
        </ul>
        <div class="tab-content">
            <div id="subject" class="tab-pane active">
                <h3 style="color: #A5CAE4; font-size: 16px; margin-bottom: 6px; border-bottom: 1px solid #D7EDFC; line-height: 1.28">
                    Subjects
                </h3>
                <table class="table table-striped" style="text-align: center">
                    <thead>
                        <tr>
                            <th></th>
                            <th>Code</th>
                            <th>Name</th>
                            <th>Join time</th>
                        </tr>
                    </thead>
                    <tbody>
                        @if (Model.Count <= 0)
                        {
                            <tr>
                                <td colspan="4">
                                    No result
                                </td>
                            </tr>
                        }
                        else
                        {
                            for (var i = 0; i < Model.Count(); i++)
                            {
                                <tr>
                                    <td>@(i + 1)</td>
                                    <td>@Model[i].Subject.Code</td>
                                    <td>
                                        @Html.ActionLink(@Model[i].Subject.Name, "Details", "Subject", new { id = @Model[i].SubjectId }, null)
                                    </td>
                                    <td>@Model[i].JoinedTime</td>
                                </tr>
                            }
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>